home *** CD-ROM | disk | FTP | other *** search
/ Sprite 1984 - 1993 / Sprite 1984 - 1993.iso / src / boot / decprom / RCS / byte.c,v < prev    next >
Encoding:
Text File  |  1990-02-17  |  1.3 KB  |  80 lines

  1. head     1.1;
  2. branch   ;
  3. access   ;
  4. symbols  ;
  5. locks    ; strict;
  6. comment  @ * @;
  7.  
  8.  
  9. 1.1
  10. date     90.02.16.16.14.06;  author shirriff;  state Exp;
  11. branches ;
  12. next     ;
  13.  
  14.  
  15. desc
  16. @@
  17.  
  18.  
  19.  
  20. 1.1
  21. log
  22. @Initial revision
  23. @
  24. text
  25. @/*
  26.  *----------------------------------------------------------------------
  27.  * 
  28.  * bcopy --
  29.  *
  30.  *    Copy numBytes from *sourcePtr to *destPtr.  This routine is
  31.  *    optimized to do transfers when sourcePtr and destPtr are both
  32.  *    integer-aligned and point to large areas.
  33.  *
  34.  * Results:
  35.  *    There is no return value.  The memory at *destPtr is modified.
  36.  *
  37.  * Side effects:
  38.  *    None.
  39.  *
  40.  *----------------------------------------------------------------------
  41.  */
  42.  
  43. bcopy(sourcePtr, destPtr, numBytes)
  44.     register char *sourcePtr;        /* Where to copy from */
  45.     register char *destPtr;        /* Where to copy to */
  46.     register int numBytes;    /* The number of bytes to copy */
  47. {
  48.     while (numBytes-- > 0) {
  49.     *(destPtr++) = *(sourcePtr++);
  50.     }
  51. }
  52. bzero( destPtr, numBytes)
  53.     register char *destPtr;        /* Where to zero to */
  54.     register int numBytes;    /* The number of bytes to zero */
  55. {
  56.     while (numBytes-- > 0) {
  57.     *(destPtr++) = 0;
  58.     }
  59. }
  60.  
  61. strcmp(s1, s2)
  62.      register char *s1, *s2;
  63. {
  64.      while (1) {
  65.     if (*s1 != *s2) {
  66.         if (*s1 > *s2) {
  67.         return 1;
  68.         } else {
  69.         return -1;
  70.         }
  71.     }
  72.     if (*s1++ == 0) {
  73.         return 0;
  74.     }
  75.     s2 += 1;
  76.     }
  77.  
  78. }
  79. @
  80.